package com.google.android.gms.internal;

import java.io.IOException;

public final class zzfmb extends zzflm<zzfmb> {
    private byte[] body = null;
    private zzfly[] zzpww = zzfly.zzdcs();
    private byte[] zzpwx = null;
    private Integer zzpwy = null;
    private zzfmc zzpxc = null;
    private byte[] zzpxd = null;

    public zzfmb() {
        this.zzpvl = null;
        this.zzpnr = -1;
    }

    public final /* synthetic */ zzfls zza(zzflj zzflj) throws IOException {
        while (true) {
            int zzcxx = zzflj.zzcxx();
            if (zzcxx == 0) {
                return this;
            }
            if (zzcxx == 10) {
                if (this.zzpxc == null) {
                    this.zzpxc = new zzfmc();
                }
                zzflj.zza(this.zzpxc);
            } else if (zzcxx == 18) {
                int zzb = zzflv.zzb(zzflj, 18);
                int length = this.zzpww == null ? 0 : this.zzpww.length;
                zzfly[] zzflyArr = new zzfly[(zzb + length)];
                if (length != 0) {
                    System.arraycopy(this.zzpww, 0, zzflyArr, 0, length);
                }
                while (length < zzflyArr.length - 1) {
                    zzflyArr[length] = new zzfly();
                    zzflj.zza(zzflyArr[length]);
                    zzflj.zzcxx();
                    length++;
                }
                zzflyArr[length] = new zzfly();
                zzflj.zza(zzflyArr[length]);
                this.zzpww = zzflyArr;
            } else if (zzcxx == 26) {
                this.body = zzflj.readBytes();
            } else if (zzcxx == 34) {
                this.zzpwx = zzflj.readBytes();
            } else if (zzcxx == 40) {
                this.zzpwy = Integer.valueOf(zzflj.zzcya());
            } else if (zzcxx == 50) {
                this.zzpxd = zzflj.readBytes();
            } else if (!super.zza(zzflj, zzcxx)) {
                return this;
            }
        }
    }

    public final void zza(zzflk zzflk) throws IOException {
        if (this.zzpxc != null) {
            zzflk.zza(1, (zzfls) this.zzpxc);
        }
        if (this.zzpww != null && this.zzpww.length > 0) {
            for (zzfly zzfly : this.zzpww) {
                if (zzfly != null) {
                    zzflk.zza(2, (zzfls) zzfly);
                }
            }
        }
        if (this.body != null) {
            zzflk.zzc(3, this.body);
        }
        if (this.zzpwx != null) {
            zzflk.zzc(4, this.zzpwx);
        }
        if (this.zzpwy != null) {
            zzflk.zzad(5, this.zzpwy.intValue());
        }
        if (this.zzpxd != null) {
            zzflk.zzc(6, this.zzpxd);
        }
        super.zza(zzflk);
    }

    /* access modifiers changed from: protected */
    public final int zzq() {
        int zzq = super.zzq();
        if (this.zzpxc != null) {
            zzq += zzflk.zzb(1, (zzfls) this.zzpxc);
        }
        if (this.zzpww != null && this.zzpww.length > 0) {
            for (zzfly zzfly : this.zzpww) {
                if (zzfly != null) {
                    zzq += zzflk.zzb(2, (zzfls) zzfly);
                }
            }
        }
        if (this.body != null) {
            zzq += zzflk.zzd(3, this.body);
        }
        if (this.zzpwx != null) {
            zzq += zzflk.zzd(4, this.zzpwx);
        }
        if (this.zzpwy != null) {
            zzq += zzflk.zzag(5, this.zzpwy.intValue());
        }
        return this.zzpxd != null ? zzq + zzflk.zzd(6, this.zzpxd) : zzq;
    }
}
